package vip.liux.backend.application.service.messaging;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import vip.liux.contracts.infrastructure.messaging.MessageBus;

@Component
public class MessagingApplicationRunner implements ApplicationRunner {

    @Autowired
    private MessageTemplateService notificationPolicyService;

    @Override
    public void run(ApplicationArguments args) {
        MessageBus.init(notificationPolicyService.list(null).getItems());
    }
}
